//package ay.shadow.shadowcommongateway.handler;
//
//
//import jakarta.servlet.http.HttpServletRequest;
//import jakarta.servlet.http.HttpServletResponse;
//import org.springframework.stereotype.Component;
//import org.springframework.web.servlet.HandlerInterceptor;
//
///**
// * @author shadow
// */
//@Component
//public class ShadowServerHandler implements HandlerInterceptor {
//
////    @Autowired
////    RedisTemplate<String, String> redisTemplate;
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object obj) throws Exception {
//        // 获取当前请求头from信息
//        String secretKey = request.getHeader("from");
//        // 获取gatewayToken
////        String gatewayToken = redisTemplate.opsForValue().get("gatewayToken");
////
////        if(secretKey == null || !secretKey.equals(gatewayToken)) {
////            response.setContentType("application/json;charset=utf-8");
////            PrintWriter writer = response.getWriter();
////            writer.write("非法访问！");
////            return false;
////        }
//        return true;
//    }
//}
